VxCenterVertically targetWidget sourceWidget
Given two widgets which have been created with the sourceWidget positioned via -alignTop relative to the targetWidget, this sets the top offset of the sourceWidget so that the targetWidget is in the center.
The following code produces two PushButtons, with the right PushButton aligned with the center of the left PushButton.
set app [VtOpen demo] set fn [VtFormDialog $app.fn -title "VxCenterVertically Demo" ] set but1 [VtPushButton $fn.but1 \ -leftSide FORM \ -label "Bananas, Apples, Melons\n\nand\n\nGrapefruit"] set but2 [VtPushButton $fn.but2 \ -rightSide FORM \ -leftSide but1 \ -alignTop but1 \ -label "Kumquats"] VxCenterVertically $but1 $but2 VtShow $fn VtMainLoop
This code produces the following: